import _ from 'lodash'
const term = {
    portal:{
        notify:{

            value: "请保存或还原当前方案",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.notify",
        },
        backup:{
            value: "还原当前方案",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.backup",
        },
        searchPlaceholder:{
            value: "请输入名称进行搜索",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.searchPlaceholder",
        },
        defaultTitle:{
            value: "业务主题",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.defaultTitle",
        },
        subordinate:{
            value: "下级",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.subordinate",
        },
        new:{
            value: "最新",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.new",
        },
        hot:{
            value: "最热门",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.hot",
        },
        menu:{
            value: "菜单",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.menu",
        },
        add:{
            value: "添加部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.add",
        },
        toggle:{
            value: "门户切换",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.toggle",
        },
        edit:{
            value: "编辑",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.edit",
        },
        saveEdit:{
            value: "保存编辑",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.saveEdit",
        },
        delete:{
            value: "删除当前方案",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.delete",
        },
        reset:{
            value: "恢复默认设置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.reset",
        },
        confirm:{
            value: "确认",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.confirm",
        },
        cancel:{
            value: "取消",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.cancel",
        },
        paramTitle:{
            value: "参数设置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.paramTitle",
        },
        close:{
            value: "关闭编辑模式",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portal.close",
        },

    },
    message:{
        warn:{
            value: "警告",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.warn",
        },
        mutualWarnMessage:{
            value: "交互配置信息不全",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.mutualWarnMessage",
        },
        addPortalWarnMessage:{
            value: "请选择部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.addPortalWarnMessage",
        },
        portalWarnMessage:{
            value: "请选择一个部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.portalWarnMessage",
        },
        noPortalWarnMessage:{
            value: "未获取到门户实例信息！",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.noPortalWarnMessage",
        },
        notify:{
            value: "消息提醒",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.notify",
        },
        saveSuccess:{
            value: "保存成功",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.saveSuccess",
        },
        confirm:{
            value: "提示",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.confirm",
        },
        saveInstance:{
            value: "当前门户实例保存为",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.saveInstance",
        },
        noPersonSetting:{
            value: "您还未进行个人门户的设置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.noPersonSetting",
        },
        resetDefaultMessage:{
            value: "确定要恢复默认设置吗？",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.resetDefaultMessage",
        },
        delSuccess:{
            value: "删除成功",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.delSuccess",
        },
        cantDelDefault:{
            value: "系统默认设置无法删除！",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.cantDelDefault",
        },
        getCurInsError:{
            value: "获取当前门户信息异常！",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.getCurInsError",
        },
        confirmDelCurMessage:{
            value: "确定要删除当前方案吗？",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.message.confirmDelCurMessage",
        },

    },
    contextMenu:{
        edit:{
            value: "组件编辑",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.contextMenu.edit",
        },
        mutual:{
            value: "交互配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.contextMenu.mutual",
        },
        refresh:{
            value: "刷新组件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.contextMenu.refresh",
        },
        delete:{
            value: "删除",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.contextMenu.delete",
        }
    },
    mutual:{
        title:{
            value: "交互配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.title",
        },
        relationObject:{
            value: "选择关联对象",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.relationObject",
        },
        relationObjectEvent:{
            value: "选择订阅的事件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.relationObjectEvent",
        },
        responseEvent:{
            value: "选择执行动作",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.responseEvent",
        },
        paramBindPlaceholder:{
            value: "选择绑定变量",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.paramBindPlaceholder",
        },
        paramBind:{
            value: "参数绑定",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.paramBind",
        },
        eventBind:{
            value: "事件绑定",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.eventBind",
        },
        paramBindeExplain:{
            value: "部件入参如果选定关联全局变量,就能与其联动",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.paramBindeExplain",
        },
        eventBindExplain:{
            value: "选择当某个元素的触发动作时,自身所要执行的操作",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.mutual.eventBindExplain",
        },
    },
    portalType:{
        default:{
            value: "系统预置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalType.default",
        },
        system:{
            value: "系统默认",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalType.system",
        },
        person:{
            value: "个人方案",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalType.person",
        },
    },
    addPortal:{
        titleHeight:{
            value: "标题栏高度",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.titleHeight",
        },
        titleColor:{
            value: "标题栏背景色",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.titleColor",
        },
        showTitle:{
            value: "是否显示标题",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showTitle",
        },
        pleaseSelect:{
            value: "请选择部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.pleaseSelect",
        },
        title:{
            value: "添加部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.title",
        },
        editTitle:{
            value: "编辑部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.editTitle",
        },
        portlet:{
            value: "小部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.portlet",
        },
        basicConfig:{
            value: "基础配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.basicConfig",
        },
        portletConfig:{
            value: "部件配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.portletConfig",
        },
        paramConfig:{
            value: "参数配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.paramConfig",
        },
        name:{
            value: "标题",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.name",
        },
        showToolsbar:{
            value: "显示标题栏",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showToolsbar",
        },
        showRefreshBtn:{
            value: "显示标刷新按钮",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showRefreshBtn",
        },
        showInterval:{
            value: "是否定时刷新",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showInterval",
        },
        intervalValue:{
            value: "刷新频率(分钟)",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.intervalValue",
        },
    },
    addIndicatorPortal:{
        titleHeight:{
            value: "标题栏高度",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.titleHeight",
        },
        titleColor:{
            value: "标题栏背景色",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.titleColor",
        },
        showTitle:{
            value: "是否显示标题",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showTitle",
        },
        pleaseSelect:{
            value: "请选择指标部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.pleaseSelect",
        },
        title:{
            value: "添加指标部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.title",
        },
        editTitle:{
            value: "编辑指标部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.editTitle",
        },
        portlet:{
            value: "小部件",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.portlet",
        },
        basicConfig:{
            value: "基础配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.basicConfig",
        },
        portletConfig:{
            value: "部件配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.portletConfig",
        },
        paramConfig:{
            value: "参数配置",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.paramConfig",
        },
        name:{
            value: "标题",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.name",
        },
        showToolsbar:{
            value: "显示标题栏",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showToolsbar",
        },
        showRefreshBtn:{
            value: "显示标刷新按钮",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showRefreshBtn",
        },
        showInterval:{
            value: "是否定时刷新",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.showInterval",
        },
        intervalValue:{
            value: "刷新频率(分钟)",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.addPortal.intervalValue",
        },
    },
    portalList:{
        title:{
            value: "部件库",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.title",
        },
        portalListSearch:{
            value: "查询",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.portalListSearch",
        },
        placehold:{
            value: "请输入部件名称",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.placehold",
        },
        preview:{
            value: "预览",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.preview",
        },
        all:{
            value: "全部",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.all",
        },
        noData:{
            value: "暂无数据",
            ReferenceExpr: "Schema.Controls.fas_portal.Terms.portalList.noData",
        },
    }

  };
  //初始化执行数据
  for(let i in term){
      for(let j  in term[i]){
         let data =  term[i][j].ReferenceExpr.split(".").reduce((prev, cur) => {
          try {
            if (!!prev[cur]) {
              return prev[cur];
            } else {
              return term[i][j].value

            }
          } catch (error) {
            return term[i][j].value

          }
        }, _.cloneDeep(window.localMessage?localMessage['fas_common']:{}));
        term[i][j]=data
      }
  }
  export const Terms = term
